<!DOCTYPE html>
<html>
<head>
  <title>billTableCondition.html</title>

  <meta name="keywords" content="keyword1,keyword2,keyword3">
  <meta name="description" content="this is my page">
  <meta name="content-type" content="text/html; charset=UTF-8">
  <style>
  	.main{
  		text-align:center;
  		width:100%;
  		height:50%;
  		position:absolute;
  		top:50%;
  		margin-top:-20%;
  	}
  	.row{
  		margin-bottom:10px;
  	}
  </style>
  <link rel="stylesheet" href="/Hospital/lib/layui-v2.1.6/layui/css/layui.css" media="all">
</head>
  
<body>
	<div class="main">
		<div class="layui-container">
			<form class="layui-form" action="">
				<div class="layui-row row">
					<div class="layui-col-xs4"><label class="layui-form-label">起始时间</label></div>
					<div class="layui-col-xs6"><input class="layui-input" lay-verify="required" type="text" id="date1"></div>
				</div>
				<div class="layui-row row">
					<div class="layui-col-xs4"><label class="layui-form-label">结束时间</label></div>
					<div class="layui-col-xs6"><input class="layui-input" lay-verify="required" type="text"  id="date2"></div>
				</div>
				<div class="layui-row row">
					<div class="layui-col-xs4"><label class="layui-form-label">单据类型</label></div>
					<div class="layui-col-xs6">
						<select id="category" name="category">
							<option value="treatmentBill">治疗单据</option>
							<option value="fundBill">费用单据</option>
						</select>
					</div>
				</div>
				<button name="submit" lay-submit="" lay-filter="submit" style="display:none"></button>
			</form>
		</div>
	</div>
</body>
<script src="/Hospital/lib/jquery.min.js" charset="utf-8"></script>
<script src="/Hospital/lib/layui-v2.1.6/layui/layui.js" charset="utf-8"></script>
<script>
	var nowdate = new Date();
	var maxdate = nowdate.getFullYear()+"-";
	maxdate += nowdate.getMonth()+1+"-";
	maxdate += nowdate.getDate();
	var isSuccess = 0;
	layui.use(['laydate','form'],function(){
		var laydate = layui.laydate;
		var laydate2 = layui.laydate;
		var form = layui.form;
		form.render();
		form.on('submit(submit)',function(){
			var date1 = $('#date1').val();
			var date2 = $('#date2').val();
			var category = $('#category').find("option:selected").val();
			var data={
				"date1" : date1,
				"date2" : date2,
				category : category
			};
			console.log("billTableCondition.data");
			console.log(data);
			localStorage.setItem("billTableCondition", JSON.stringify(data));
			isSuccess = 1;
		});
		laydate.render({
			elem : '#date1',
			max : maxdate
		});
		laydate2.render({
			elem : '#date2',
			max : maxdate
		});
	});
	function submit(){
		$('button[name="submit"]').click();
		return isSuccess;
	}
</script>
</html>
